Historical updating oE diff, Revision 1

diff

include datetime.e 
namespace datetime 
public function diff(datetime dt1, datetime dt2) 

computes the difference, in seconds, between two dates.

Parameters:
  1. dt1 : the end datetime
  2. dt2 : the start datetime
Returns:

An atom, the number of seconds elapsed from dt2 to dt1.

Comments:

dt2 is subtracted from dt1, therefore, you can come up with a negative value.

Example 1:
d1 = now() 
sleep(15)  -- sleep for 15 seconds 
d2 = now() 
 
i = diff(d1, d2) -- i is 15 
See Also:

add, subtract

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu